﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Collections;
using System.Configuration.Install;

namespace EventScavenger
{
	static class Program
	{
        private const string serviceName = "Event scavenger";
        private const string displayName = "Event Scavenger";
        private const string description = "Event Scavenger scavenging service";

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                if (args[0].ToUpper() == "-INSTALL")
                {
                    HenIT.Services.ServiceRegister.InstallService(
                        System.Reflection.Assembly.GetExecutingAssembly().Location,
                        serviceName,
                        displayName,
                        description);
                    return;
                }
                else if (args[0].ToUpper() == "-UNINSTALL")
                {
                    HenIT.Services.ServiceRegister.UnInstallService(
                        System.Reflection.Assembly.GetExecutingAssembly().Location,
                        serviceName);
                    return;
                }
            }
			ServiceBase[] ServicesToRun;
			ServicesToRun = new ServiceBase[] 
			{ 
				new EventScavenger() 
			};
			ServiceBase.Run(ServicesToRun);
		}
	}
}
